package com.tal.jzb.controller;

import com.tal.jzb.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.Min;

/**
 * @author xiefengsong
 * @date 2019-01-24 10:15
 */
@RestController
@RequestMapping(value = "/user")
@Api(tags = "用户信息")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping(value = "/get/{id}")
    @ApiOperation(value = "通过id获取用户信息", httpMethod = "GET", notes = "这是描述文本~")
    public Object getUserById(@PathVariable @ApiParam(value = "这是id") Integer id) {
        return userService.getUserById(id);
    }

    @GetMapping(value = "/findUserByName")
    @ApiOperation(value = "通过用户姓名查询用户信息", httpMethod = "GET", notes = "这是描述文本~")
    public Object findUserByName(@RequestParam String name){
        return userService.findUserByName(name);
    }



}
